//
//  TYCarouselView.h
//  Somago
//
//  Created by 谢航宇_WORK on 2021/12/29.
//  Copyright © 2021 juniu. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "TYPageControl.h"
NS_ASSUME_NONNULL_BEGIN

@protocol TYCarouselViewDelegate;
@interface TYCarouselView : UIView
@property (assign, nonatomic) NSUInteger currentIndex;
@property (assign, nonatomic) NSTimeInterval timeInterval;
@property (assign, nonatomic) BOOL          hiddenTimer;
@property (assign, nonatomic) BOOL          hiddenDraggingScroll;
@property (strong, nonatomic) TYPageControl *pageControl;
@property (weak, nonatomic) id <TYCarouselViewDelegate> delegate;
@property (nonatomic) UICollectionViewScrollDirection scrollDirection;
- (void)registerClass:(nullable Class)cellClass forCellWithReuseIdentifier:(NSString *)identifier;
- (__kindof UICollectionViewCell *)dequeueReusableCellWithReuseIdentifier:(NSString *)identifier forIndex:(NSInteger)index;
- (void)reloadData;
@end

@protocol TYCarouselViewDelegate <NSObject>
@required
- (UICollectionViewCell *)carouselView:(TYCarouselView *)carouselView cellForItemAtIndex:(NSInteger)index;

- (NSInteger)numberOfItemsForCarouselView:(TYCarouselView *)carouselView;

@optional
- (void)carouselView:(TYCarouselView *)carouselView scrollToIndex:(NSInteger)index;
- (void)carouselView:(TYCarouselView *)carouselView didSelectedAtIndex:(NSInteger)index;
@end

NS_ASSUME_NONNULL_END
